#define _CRT_SECURE_NO_WARNINGS 1

class Solution {
public:
    int abs(int a)
    {
        return a >= 0 ? a : -a;
    }
    int maxAdjacentDistance(vector<int>& nums) {
        int res = 0, n = nums.size();;
        for (int i = 0; i < n; i++)
        {
            res = max(res, abs(nums[i] - nums[(i + 1) % n]));
        }
        return res;
    }
};